﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shape.Mvp.Sample.Domain.Model;

namespace Shape.Mvp.Sample.Domain.Repositories
{
   public class InMemoryExerciseRepository : IRepository<Exercise>
   {
      private ICollection<Exercise> _exercises =
         new List<Exercise>() {
            new Exercise() {Id = Guid.NewGuid(), Name = "Press-up"},
            new Exercise() {Id = Guid.NewGuid(), Name = "Crunch"},
            new Exercise() {Id = Guid.NewGuid(), Name = "Squat"},
            new Exercise() {Id = Guid.NewGuid(), Name = "Deadlift"},
            new Exercise() {Id = Guid.NewGuid(), Name = "Bench Press"}};

      public ICollection<Exercise> GetAll()
      {
         return _exercises;
      }

      public Exercise GetById(Guid id)
      {
         return _exercises
                  .Where(e => e.Id == id)
                  .SingleOrDefault();
      }
   }
}
